package com.elephant.bean.lookupAndReplace.replace;

import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    
    private User user;
    
    @Override
    public User createUser() {
        // 原始方法返回固定的 User 实例
        if (this.user == null) {
            this.user = new User();
            this.user.setName("Default User");
        }
        return this.user;
    }
    
    @Override
    public void printUser() {
        User user = createUser();
        System.out.println("Current user: " + user);
    }
}    